package com.edu.commons;

import lombok.Getter;

/**
 * @ProjectName: summer-project
 * @Titile: ServiceCode
 * @Author: Lucky
 * @Description: 统一业务码
 */
@Getter
public enum ServiceCode {
    /*操作成功*/
    OK(20000),
    /*操作失败*/
    ERROR(50000),
    /*登录失败*/
    ERROR_LOGIN_FAIL(60001),
    /*离职*/
    ERROR_EMP_LEAVE(60002),
    /*员工被禁用*/
    ERROR_EMP_DISABLED(60003),
    /*token过期*/
    ERROR_TOKEN_EXPIRE(60004),
    /*不支持的token*/
    ERROR_TOKEN_INVALID(60005),
    /*token为空*/
    ERROR_TOKEN_IS_NULL(60006),
    /*错误的请求参数*/
    ERROR_BAD_REQUEST(70002),
    /*查找的数据不存在*/
    ERROR_DATA_NOT_FOUND(70003),
    /*新增失败*/
    ERROR_ADD_FAIL(70004),
    /*修改失败*/
    ERROR_UPDATE_FAIL(70005),
    /*删除失败*/
    ERROR_DELETE_FAIL(70006),
    /*文件上传失败*/
    ERROR_FILE_UPLOAD_FAIL(70007),
    /*未知错误*/
    ERROR_UN_KNOW(90000);
    //生成getter方法，方便外部访问
    private int code;

    ServiceCode(int code) {
        this.code = code;
    }
}
